package com.ccom.api.feign.fallback;

import com.ccom.api.feign.SysBaseFeign;
import com.ccom.core.common.model.dto.message.*;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

/**
 * ISysBaseAPI的fallback的方法
 */
@Slf4j
public class SysBaseFeignFallback implements SysBaseFeign {

    @Setter
    private Throwable cause;

    @Override
    public void sendSysAnnouncement(MessageDTO message) {
        log.error("发送消息失败 {}", cause);
    }

    @Override
    public void sendBusAnnouncement(BusMessageDTO message) {
        log.error("发送消息失败 {}", cause);
    }

    @Override
    public void sendTemplateAnnouncement(TemplateMessageDTO message) {
        log.error("发送消息失败 {}", cause);
    }

    @Override
    public void sendBusTemplateAnnouncement(BusTemplateMessageDTO message) {
        log.error("发送消息失败 {}", cause);
    }

    @Override
    public String parseTemplateByCode(TemplateDTO templateDTO) {
        log.error("通过模板获取消息内容失败 {}", cause);
        return null;
    }

    @Override
    public void sendWebSocketMsg(String[] userIds, String cmd) {

    }

    @Override
    public void sendEmailMsg(String email, String title, String content) {

    }
}
